<%@ Page Title="" Language="C#" MasterPageFile="~/Forms/Site.Master" AutoEventWireup="true"
    CodeBehind="PlanillasGenerales.aspx.cs" Inherits="SchoolManagement.Forms.PlanillasGenerales" %>

<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%">
        <tr>
            <td>
                <asp:CheckBox ID="CheckBoxFiltrarCurso" runat="server" Text="Curso" AutoPostBack="True" />
            </td>
            <td>
                <asp:DropDownList ID="DropDownListCurso" runat="server" DataSourceID="LinqDataSourceCursos"
                    DataTextField="Grado" DataValueField="Id" AutoPostBack="True" OnSelectedIndexChanged="DropDownListCurso_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td>
                <asp:CheckBox ID="CheckBoxFiltrarAsignatura" runat="server" Text="Asignatura" />
            </td>
            <td>
                <asp:DropDownList ID="DropDownListAsignatura" runat="server" DataSourceID="LinqDataSourceAsig"
                    DataTextField="Asignatura" DataValueField="IdAsignatura">
                </asp:DropDownList>
            </td>
            <td>
                <asp:CheckBox ID="CheckBoxFiltrarDocente" runat="server" Text="Docente" />
            </td>
            <td>
                <asp:DropDownList ID="DropDownListDocente" runat="server" DataSourceID="LinqDataSourceDocente"
                    DataTextField="Docente" DataValueField="IdPersona">
                </asp:DropDownList>
            </td>
            <td>
                <asp:CheckBox ID="CheckBoxFiltrarEstudiante" runat="server" Text="Estudiante" />
            </td>
            <td>
                <asp:DropDownList ID="DropDownListEstudiante" runat="server" DataSourceID="LinqDataSourceEstudiante"
                    DataTextField="Estudiante" DataValueField="IdPersona">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:LinkButton ID="LinkButtonAsociarCursos" runat="server"
                    Font-Size="X-Small" PostBackUrl="~/Forms/ReportFinalPlanilla.aspx">Generar Reporte Curso Seleccionado</asp:LinkButton>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
            </td>
            <td>
                <asp:LinkButton ID="LinkButton1" runat="server" OnClick="generarReporteAllCursos_Click"
                    Font-Size="X-Small">Generar Reporte All Cursos</asp:LinkButton>
            </td>
            <td>
                <asp:Label ID="LabelNivel" runat="server" Text="Nivel" Font-Size="X-Small"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="DropDownListNivel" runat="server" DataSourceID="LinqDataSourceNivel"
                    DataTextField="Nombre" DataValueField="Id" AutoPostBack="True">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td colspan="8" align="center">
                <asp:Button ID="ButtonBuscar" runat="server" Text="Buscar" OnClick="ButtonBuscar_Click" />
                <br />
            </td>
        </tr>
        <tr>
            <td colspan="8" align="center">
                <asp:Panel ID="Panel1" runat="server" Height="383px" ScrollBars="Vertical">
                    <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"
                        AutoGenerateColumns="False" DataSourceID="ObjectDataSourcePlantillas">
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="IdEstudiante" HeaderText="IdEstudiante" SortExpression="IdEstudiante"
                                Visible="False" />
                            <asp:BoundField DataField="IdTipoDocumento" HeaderText="IdTipoDocumento" SortExpression="IdTipoDocumento"
                                Visible="False" />
                            <asp:BoundField DataField="NumeroDocumento" HeaderText="NumeroDocumento" SortExpression="NumeroDocumento"
                                Visible="False" />
                            <asp:BoundField DataField="Estudiante" HeaderText="Estudiante" SortExpression="Estudiante" />
                            <asp:BoundField DataField="IdNivel" HeaderText="IdNivel" SortExpression="IdNivel"
                                Visible="False" />
                            <asp:BoundField DataField="Salon" HeaderText="Salon" SortExpression="Salon" Visible="False" />
                            <asp:BoundField DataField="IdGrado" HeaderText="IdGrado" SortExpression="IdGrado"
                                Visible="False" />
                            <asp:BoundField DataField="Asignatura" HeaderText="Asignatura" SortExpression="Asignatura" />
                            <asp:BoundField DataField="IdDocente" HeaderText="IdDocente" SortExpression="IdDocente"
                                Visible="False" />
                            <asp:BoundField DataField="Docente" HeaderText="Docente" SortExpression="Docente" />
                            <asp:BoundField DataField="Grado" HeaderText="Grado" SortExpression="Grado" />
                            <asp:TemplateField HeaderText="A1"></asp:TemplateField>
                            <asp:TemplateField HeaderText="A2"></asp:TemplateField>
                            <asp:TemplateField HeaderText="A3"></asp:TemplateField>
                            <asp:TemplateField HeaderText="P1"></asp:TemplateField>
                            <asp:TemplateField HeaderText="P2"></asp:TemplateField>
                            <asp:TemplateField HeaderText="P3"></asp:TemplateField>
                            <asp:TemplateField HeaderText="P4"></asp:TemplateField>
                            <asp:TemplateField HeaderText="A4"></asp:TemplateField>
                            <asp:TemplateField HeaderText="F1"></asp:TemplateField>
                            <asp:TemplateField HeaderText="F2"></asp:TemplateField>
                            <asp:TemplateField HeaderText="F3"></asp:TemplateField>
                            <asp:TemplateField HeaderText="F4"></asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <asp:LinqDataSource ID="LinqDataSourceCursos" runat="server" ContextTypeName="AccesoDatos.DataClassesSchoolDataContext"
                        Select="new (Id, Grado, IdNivel)" TableName="SelectGrados">
                    </asp:LinqDataSource>
                    <asp:LinqDataSource ID="LinqDataSourceAsig" runat="server" ContextTypeName="AccesoDatos.DataClassesSchoolDataContext"
                        Select="new (IdAsignatura, IdGrado, Asignatura)" TableName="SelectAsignaturasGrados"
                        Where="IdGrado == @IdGrado">
                        <WhereParameters>
                            <asp:ControlParameter ControlID="DropDownListCurso" Name="IdGrado" PropertyName="SelectedValue"
                                Type="Int32" />
                        </WhereParameters>
                    </asp:LinqDataSource>
                    <asp:LinqDataSource ID="LinqDataSourceDocente" runat="server" ContextTypeName="AccesoDatos.DataClassesSchoolDataContext"
                        Select="new (IdPersona, Docente)" TableName="DatosDocentes">
                    </asp:LinqDataSource>
                    <asp:LinqDataSource ID="LinqDataSourceEstudiante" runat="server" ContextTypeName="AccesoDatos.DataClassesSchoolDataContext"
                        Select="new (IdPersona, Estudiante)" TableName="DatosEstudiantes">
                    </asp:LinqDataSource>
                    <asp:ObjectDataSource ID="ObjectDataSourcePlantillas" runat="server" SelectMethod="GetPlanillas"
                        TypeName="BussinessLogic.Planillas">
                        <SelectParameters>
                            <asp:SessionParameter DefaultValue="IsDataNeeded" Name="isLoadAllNeeded" SessionField="IsDataNeeded"
                                Type="Boolean" />
                            <asp:ControlParameter ControlID="CheckBoxFiltrarCurso" DefaultValue="" Name="filtroGrados"
                                PropertyName="Checked" Type="Boolean" />
                            <asp:ControlParameter ControlID="CheckBoxFiltrarAsignatura" Name="filtroAsignatura"
                                PropertyName="Checked" Type="Boolean" />
                            <asp:ControlParameter ControlID="CheckBoxFiltrarDocente" Name="filtroDocente" PropertyName="Checked"
                                Type="Boolean" />
                            <asp:ControlParameter ControlID="CheckBoxFiltrarEstudiante" Name="filtroEstudiante"
                                PropertyName="Checked" Type="Boolean" />
                            <asp:ControlParameter ControlID="DropDownListCurso" Name="idGrado" PropertyName="SelectedValue"
                                Type="Int32" />
                            <asp:ControlParameter ControlID="DropDownListAsignatura" Name="idAsignatura" PropertyName="SelectedValue"
                                Type="Int32" />
                            <asp:ControlParameter ControlID="DropDownListDocente" Name="idDocente" PropertyName="SelectedValue"
                                Type="Int32" />
                            <asp:ControlParameter ControlID="DropDownListEstudiante" Name="idEstudiante" PropertyName="SelectedValue"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:LinqDataSource ID="LinqDataSourceNivel" runat="server" ContextTypeName="AccesoDatos.DataClassesSchoolDataContext"
                        Select="new (Id, Nombre)" TableName="Nivels">
                    </asp:LinqDataSource>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>
